<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html class="con">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
</head>
<body>
<c:forEach items="${users}" var="user">

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>个人设置</legend>
</fieldset>
<!--如果没有method就不会将数据传输到后台-->
<form class="layui-form" action="/updateuser.do" method="post">
    <div class="layui-input-block">
        <input style="display:none" name="id"  id="id"  autocomplete="off" value="${user.id}" class="layui-input">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" name="username"  id="username"  autocomplete="off" value="${user.username}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-block">
            <input type="text" name="loginname" id="loginname"   value="${user.loginname}" autocomplete="off" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">生日</label>
        <div class="layui-input-inline">
            <input type="text" name="brithday" id="brithday" value="${user.brithday}" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="text" name="password"  id="password"  value="${user.password}" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请填写6到12位密码</div>
    </div>
    <div>

        <div class="layui-form-item">
            <label class="layui-form-label">爱好</label>
            <div class="layui-input-inline">
                <input type="text" name="likes" id="likes" value="${user.likes}" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="text" name="sex" id="sex" value="${user.sex}" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="tel" name="phone"  id="phone"  autocomplete="off"  value="${user.phone}"  class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-inline">
                <input type="text" name="card"  id="card" value="${user.card}"  autocomplete="off" class="layui-input">
            </div>
        </div>
        </c:forEach>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="">确认</button>
                <button type="reset" class="layui-btn layui-btn-primary" ><a href="/user.do">退出</a></button>
            </div>
        </div>
    </div>
</form>
<%--<script src="/layui/js/layui.js" charset="utf-8">--%>
<%--<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->--%>
<%--    layui.use(['form', 'layedit', 'laydate'], function(){--%>
<%--        var form = layui.form--%>
<%--            ,layer = layui.layer--%>
<%--            ,layedit = layui.layedit--%>
<%--            ,laydate = layui.laydate;--%>

<%--        //日期--%>
<%--        laydate.render({--%>
<%--            elem: '#date'--%>
<%--        });--%>
<%--        laydate.render({--%>
<%--            elem: '#date1'--%>
<%--        });--%>

<%--        //创建一个编辑器--%>
<%--        var editIndex = layedit.build('LAY_demo_editor');--%>

<%--        //自定义验证规则--%>
<%--        form.verify({--%>
<%--            title: function(value){--%>
<%--                if(value.length < 5){--%>
<%--                    return '标题至少得5个字符啊';--%>
<%--                }--%>
<%--            }--%>
<%--            ,pass: [--%>
<%--                /^[\S]{6,12}$/--%>
<%--                ,'密码必须6到12位，且不能出现空格'--%>
<%--            ]--%>
<%--            ,content: function(value){--%>
<%--                layedit.sync(editIndex);--%>
<%--            }--%>
<%--        });--%>

<%--        //监听提交--%>
<%--        form.on('submit(demo1)', function(data){--%>
<%--            layer.alert(JSON.stringify(data.field), {--%>
<%--                title: '最终的提交信息'--%>
<%--            })--%>
<%--            return false;--%>
<%--        });--%>

<%--        //表单赋值--%>
<%--        layui.$('#LAY-component-form-setval').on('click', function(){--%>
<%--            form.val('example', {--%>
<%--                "username": "贤心" // "name": "value"--%>
<%--                ,"password": "123456"--%>
<%--                ,"interest": 1--%>
<%--                ,"like[write]": true //复选框选中状态--%>
<%--                ,"close": true //开关状态--%>
<%--                ,"sex": "女"--%>
<%--                ,"desc": "我爱 layui"--%>
<%--            });--%>
<%--        });--%>

<%--        //表单取值--%>
<%--        layui.$('#LAY-component-form-getval').on('click', function(){--%>
<%--            var data = form.val('example');--%>
<%--            alert(JSON.stringify(data));--%>
<%--        });--%>

<%--    });--%>
<%--</script>--%>

</body>
</html>

